package org.grow.leave.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: xwg
 * @CreateDate: 21-7-19
 */

@RestControllerAdvice
public class ExceptionBridge {

    @ExceptionHandler(AugustException.class)
    public ResponseEntity<String> augustHandler(AugustException e){
        return new ResponseEntity<>(e.getMessage(),null,e.getCode());
    }
}
